package com.lims.admin.dao;

import javacommon.base.*;

import cn.org.rapid_framework.page.*;

import com.lims.admin.model.*;
import com.lims.admin.vo.query.*;

import org.springframework.stereotype.Repository;
/**
 * 
 * @author zzh
 *
 */
@Repository @SuppressWarnings({"unchecked"})
public class RoleDao extends BaseHibernateDao<Role,java.lang.String>{

	
	public Class getEntityClass() {
		return Role.class;
	}
	
	public Page findPage(RoleQuery query) {
        //XsqlBuilder syntax,please see http://code.google.com/p/rapid-xsqlbuilder
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接 
        // [column] 为PageRequest的属性
		String sql = "select t from Role t where 1=1 "
			  	+ "/~ and t.rolename = {rolename} ~/"
			  	+ "/~ and t.describe = {describe} ~/"
				+ "/~ order by [sortColumns] ~/";

		return pageQuery(sql,query);
	}
	

}
